package com.dreamwhale.accelerator.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dreamwhale.accelerator.common.DataResult;
import com.dreamwhale.accelerator.entity.AlLineManage;
import com.dreamwhale.accelerator.mapper.AlLineManageMapper;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 线路管理 前端控制器
 * </p>
 *
 * @author Author
 * @since 2020-08-07
 */
@RestController
@RequestMapping("/user")
public class AlLineManageController {
    @Resource
    private AlLineManageMapper alLineManageMapper;

    /**
     * 查询线路管理
     * @param type
     * @return
     */
    @RequestMapping("/selectAlLineManages")
    public DataResult selectAlLineManages(Integer type) {
        QueryWrapper<AlLineManage> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(AlLineManage::getLbDel,'0');
        if(type==1){
            queryWrapper.lambda().eq(AlLineManage::getLbType,'0');
        }else{
            queryWrapper.lambda().eq(AlLineManage::getLbType,'1');
        }

        return DataResult.ok(alLineManageMapper.selectList(queryWrapper));
    }
}

